package homeword.personPassRiver;

/**
 * 交通工具工厂类，可以直接拿到交通工具
 */
public class VehicleFactory {
    //单例，马儿是同一批马
    private static Horse horse = new Horse();

    //私有化构造方法，防止new
    private VehicleFactory(){

    }
    public static Boat getBoat(){
        return new Boat();
    }

    public static Horse getHorse(){
        return horse;
    }

    public static Aeroplane getAeroplane(){
        return new Aeroplane();
    }
}
